/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/** *****************************************************************************************************
 *  \file     Adc_Cfg.h                                                                                 *
 *  \brief    This file contains configuration for ADC MCAL driver                                      *
 *                                                                                                      *
 * <table>                                                                                              *
 * <tr><th>Date           <th>Version                                                                   *
 * <tr><td>2023/08/30     <td>1.0.0                                                                     *
 * </table>                                                                                             *
 *******************************************************************************************************/

#ifndef ADC_CFG_H
#define ADC_CFG_H

#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************************
 *                       Include header files
 *****************************************************************************************/
#include "Adc_Types.h"

extern const Adc_ConfigType Adc_Config;
/*----------------------[version identification]-----------------------------*/
/** \brief  Generate Autosar Specific Version Information. */
#define ADC_AR_RELEASE_MAJOR_VERSION                                    (4U)
#define ADC_AR_RELEASE_MINOR_VERSION                                    (3U)
#define ADC_AR_RELEASE_REVISION_VERSION                                 (1U)

/** \brief  Generate Vendor Specific Version Information. */
#define ADC_SW_MAJOR_VERSION                                            (3U)
#define ADC_SW_MINOR_VERSION                                            (1U)
#define ADC_SW_PATCH_VERSION                                            (0U)



/*
Core Configuration:
- if STD_ON, core is used
- if STD_OFF, core is not used
*/

#define ADC_CORE0_ENABLE                        (STD_ON)

#define ADC_CORE1_ENABLE                        (STD_OFF)

#define ADC_CORE2_ENABLE                        (STD_OFF)

#define ADC_CORE3_ENABLE                        (STD_OFF)


/*
Configuration:
- if STD_ON, DET is Enabled
- if STD_OFF,DET is Disabled
*/

#define ADC_PRECOMPILE_SUPPORT                  (STD_OFF)

/** \brief  Define if global variables need to be placed in non-cache area or not */
#define ADC_NO_CACHEABLE_NEEDED                 (STD_OFF)

/** \brief  Define if enable voltage calibration function */
#define ADC_VOLTAGE_CALIBRATION                 (STD_OFF)

/** Traceability       : SWSR_ADC_195 */
#define ADC_OVERVOLTAGE_DETECT                  (STD_OFF)

#define ADC_DEV_ERROR_DETECT                    (STD_ON)

#define ADC_SAFETY_ENABLE                       (STD_ON)

/** Traceability       : SWSR_ADC_070 */
#define ADC_DEINIT_API                          (STD_ON)

/** Traceability       : SWSR_ADC_007 SWSR_ADC_077
 *                       SWSR_ADC_091               */
#define ADC_ENABLE_START_STOP_GROUP_API         (STD_ON)

/** Traceability       : SWSR_ADC_106 SWSR_ADC_112 */
#define ADC_GRP_NOTIF_CAPABILITY                (STD_ON)

/** Traceability       : SWSR_ADC_008 SWSR_ADC_171
 *                       SWSR_ADC_184 */
#define ADC_HW_TRIGGER_API                      (STD_ON)
/** Traceability       : SWSR_ADC_022 SWSR_ADC_023 */
#define ADC_POWER_STATE_SUPPORTED               (STD_ON)

#define ADC_READ_GROUP_API                      (STD_ON)

/** Traceability       : SWSR_ADC_193 */
#define ADC_DMA_SUPPORTED                       (STD_ON)

#define ADC_VERSION_INFO_API                    (STD_ON)

#define ADC_USED_MAX_GROUP_CHNL_COUNT (2U)

#define ADC_USED_GROUP_COUNT (6U)

#define ADC_USED_UNIT_COUNT (3U)

/*------------------[Symbolic Names of Hardware Units]-----------------------*/
#define AdcConf_AdcHwUnit_ADC1 (0U)
#define AdcConf_AdcHwUnit_ADC2 (1U)
#define AdcConf_AdcHwUnit_ADC3 (2U)

/*------------------[Symbolic Names of Groups]-----------------------*/
/** Traceability       : SWSR_ADC_165 */
#define AdcConf_AdcGroup_Adc1_Group0 (0U)
#define AdcConf_AdcGroup_Adc1_Group1 (1U)
#define AdcConf_AdcGroup_Adc2_Group0 (2U)
#define AdcConf_AdcGroup_Adc2_Group1 (3U)
#define AdcConf_AdcGroup_Adc3_Group0 (4U)
#define AdcConf_AdcGroup_Adc3_Group1 (5U)

/*------------------[Symbolic Names of Channels]-----------------------*/
/** Traceability       : SWSR_ADC_165 */
#define AdcConf_AdcChannel_Adc1_Channel_GPIO_A8 (0U)
#define AdcConf_AdcChannel_Adc1_Channel_GPIO_A9 (1U)
#define AdcConf_AdcChannel_Adc2_Channel_GPIO_B10 (2U)
#define AdcConf_AdcChannel_Adc2_Channel_GPIO_B11 (3U)
#define AdcConf_AdcChannel_Adc3_Channel_GPIO_A8 (4U)
#define AdcConf_AdcChannel_Adc3_Channel_GPIO_A9 (5U)

#define ADC_OVERVOLTAGE_THRESHOLD 3500U

/** Traceability       : SWSR_ADC_162 */
extern void Adc1_Group1_Notif(void);
/** Traceability       : SWSR_ADC_162 */
extern void Adc2_Group1_Notif(void);
/** Traceability       : SWSR_ADC_162 */
extern void Adc3_Group0_Notif(void);
/** Traceability       : SWSR_ADC_ */
extern Adc_ValueGroupType adc3_group1_buffer[32];

#ifdef __cplusplus
}
#endif
#endif /* ADC_CFG_H */
/* End of file */
